package com.example.kt_fast.repo

import com.example.kt_common.base.BaseRepository
import com.example.kt_common.network.RespStateData
import com.example.kt_fast.api.FastApi
import com.example.kt_fast.bean.req.AddDriverInfoReq
import com.example.kt_fast.bean.resp.CarTreeBean
import com.example.kt_fast.bean.resp.UploadImgBean
import okhttp3.MultipartBody

/**
 * Created by 小陈 on 2025/3/25.
 * Time: 18:37.
 */
class FastRepo(private val api: FastApi) : BaseRepository(){

    suspend fun uploadImg(
        part: MultipartBody.Part, data: RespStateData<UploadImgBean>
    ) = dealResp(
        block = { api.uploadImg(part) }, data
    )
    suspend fun addDriverInfo(
        addDriverInfoReq: AddDriverInfoReq, data: RespStateData<String>
    ) = dealResp(
        block = { api.addDriverInfo(addDriverInfoReq) }, data
    )

    suspend fun getTreeAside(
         data: RespStateData<CarTreeBean>
    ) = dealResp(
        block = { api.getTreeAside() }, data
    )
}